package weixinkeji.dev.h;

import java.util.HashSet;
import java.util.Set;
import sys.wx.ann.hm.H;
import sys.wx.ann.hm.M;
import sys.wx.c.ATR;
import sys.wx.components.validatecode.SafeCodeServcie;

/**
 *
 * @author IK
 */
@H("components/safeCode")
public class SafeCode {

    private final static Set<String> sessionID = new HashSet();

    @M("/4numberSafeCode")//components/safeCode/4numberSafeCode.imy
    public static String pSafeCode(ATR a) {
        if (!sessionID.contains(a.session.getId())) {
            sessionID.add(a.session.getId());
            SafeCodeServcie.outImg(a);
            sessionID.remove(a.session.getId());
        }
        return null;
    }
}
